package com.imooc.ad.mysql.dto;

import com.imooc.ad.mysql.constant.OpType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Binlog变化 -> 统一处理对象BinlogRowData -> 增量数据对象MySqlRowData
 * -> 增量数据处理器IncrementListener实现转化并投递 -> IndexSender实现层级增量数据投递
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MySqlRowData {
    //表名
    private String tableName;
    //层级
    private String level;

    //对应BinlogRowData中操作类型EventType
    private OpType opType;

    //对应BinlogRowData中变化数据after，List内是map<操作表名,更新数据>格式
    private List<Map<String, String>> fieldValueMap = new ArrayList<>();
}
